El tiempo de espera para iniciar sesión esta entre 15 a 20 y en ocasiones hasta 30 segundos por lo que algunos usuarios les tiran error al iniciar sesión. alt text

 ELMAH

System.Data.Entity.Core.EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for details. ---> System.Data.SqlClient.SqlException: Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception: The wait operation timed out --- End of inner exception stack trace --- at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.Entity.Infrastructure.Interception.InternalDispatcher1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func3 operation, TInterceptionContext interceptionContext, Action3 executing, Action3 executed) at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.Reader(DbCommand command, DbCommandInterceptionContext interceptionContext) at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior) --- End of inner exception stack trace --- at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior) at System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlan.ExecuteTResultType at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess) at System.Data.Entity.Core.Objects.ObjectQuery1.<>cDisplayClass7.<getresults>b5() at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func1 operation) at System.Data.Entity.Core.Objects.ObjectQuery1.GetResults(Nullable1 forMergeOption) at System.Data.Entity.Core.Objects.ObjectQuery1.<system.collections.generic.ienumerable<t>.GetEnumerator>b__0() at System.Data.Entity.Internal.LazyEnumerator1.MoveNext() at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at Aseinfo.VH4.UI.Web.Controllers.AccountController.Login(String txtUsername, String txtPassword, Boolean chkRememberMe, Nullable`1 isSilverlightInstalled, String returnUrl) in C:vh4VH4UIWebControllersAccountController.cs:line 712

Ante este problema reportado lo que se ha realizado es lo siguiente:

 Se agregó el nombre de dominio al usuario ya que no lo tenía, pero no cambio nada, sigue con el mismo tiempo. alt text

 Se corrió la siguiente función desde el servidor de aplicaciones para probar el usuario de dominio fuera de Evolution, he identificar si también se tardaba el mismo tiempo que en Evolution, pero la respuesta fue rápida.

function Test-ADCredential{ [CmdletBinding()] param( [pscredential]$Credential )

try {
    Add-Type -AssemblyName System.DirectoryServices.AccountManagement
    if(!$Credential) {
        $Credential = Get-Credential -EA Stop
    }
    if($Credential.username.split("\").count -ne 2) {
        throw "Ingrese las credenciales en formato DOMAIN\USERNAME. Valor ingresado: $($Credential.Username)"
    }

    $DomainName = $Credential.username.Split("\")[0]
    $UserName = $Credential.username.Split("\")[1]
    $Password = $Credential.GetNetworkCredential().Password

    $PC = New-Object System.DirectoryServices.AccountManagement.PrincipalContext([System.DirectoryServices.AccountManagement.ContextType]::Domain, $DomainName)
    if($PC.ValidateCredentials($UserName,$Password)) {
        Write-Host "Exitosa la validación de las credenciales del usuario $($Credential.Username)"
        return $True
    } else {
        throw "Fallo la validación de las credenciales para el usuario$($Credential.Username)"
    }
} catch {
    Write-Host "Error ocurrido mientras se validaban las credenciales. $_"
    return $False
}

}

Configuración de Servidor Aplicaciones:

Disco Duro: 200 GB

Memoria RAM: 8.00 GB

Procesador: Intel Xeon CPU E5-2690 0 @ 2.90 GHz (2 Procesadores)

OS: Windows 2016 Standard

IIS: 10.0.14393.0

Configuración de Servidor DB:

Disco Duro OS: 200 GB

Disco Duro E (Backups): 500 GB

Disco Duro F (Datos) : 200 GB

Disco Duro G (Log): 100 GB

Disco Duro H (TempDB): 50 GB

Memoria RAM: 8.00 GB

Procesador: Intel Xeon CPU E5-2650 v2 @ 2.60 Ghz (2 Procesadores)

OS: Windows 2016 Standard 64 bits

Microsoft SQL Server Standard (64-bit) Version: 13.0.4604.0

Version de Evolution

Evolution 1.11.2.3

asked 20 Mar '20, 12:39

Lester%20Jimenez's gravatar image

Lester Jimenez
568816
accept rate: 33%


Ya se solvento el problema, se debía que la vista del cliente "sco.ptu_permisos_tpl_users" estaba estructurada de la siguiente manera:

SELECT nullif(tpl_codigo,'') ptu_codtpl, isnull(usr_username, '') ptu_username FROM sec.usr_users_v JOIN sal.tpl_tipo_planilla ON sco.permiso_tipo_planilla(tpl_codigo, usr_username) = 1

El JOIN a la tabla tipo de planilla hacia mas lento el proceso. En actualizaciones recientes ya se maneja de la siguiente manera:

SELECT cast(nullif(codtpl, 0) as int) ptu_codtpl, isnull(usr_username, '') ptu_username FROM sec.usr_users_v CROSS APPLY sco.permiso_tipo_planilla_tabla(usr_username)

Utilizando un CROSS APPLY haciendo mas eficiente el proceso.

link

answered 24 Mar '20, 16:27

Lester%20Jimenez's gravatar image

Lester Jimenez
568816
accept rate: 33%

Solo que el error no menciona nada sobre la autenticación o el dominio.

System.Data.SqlClient.SqlException: Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding

Y sucede posteriormente a la autenticación del usuario con AD.

Específicamente sucede al intentar obtener las los tipos de planilla a los que tiene acceso.

// Almacena los TiposPlanillas a los que tiene acceso el usuario
Session[Constants.TiposPlanillasAutorizadasSessionKey] =
    _seguridadContenidoService.GetTiposPlanillasAutorizadasDeUsuario(txtUsername);

Entonces la verificación debe hacerse del lado de la base de datos y porque sucedió ese error de Timeout.

link

answered 20 Mar '20, 13:39

Fernando%20Paz's gravatar image

Fernando Paz ♦♦
17.3k81635
accept rate: 51%

Me podría pasar el QUERY que hace Evolution cuando ejecuta GetTiposPlanillasAutorizadasDeUsuario.

(20 Mar '20, 15:01) Lester Jimenez Lester%20Jimenez's gravatar image

Derivado de su comentario, se revisaron los SQL que utiliza Evolution y el problema radica en el siguiente query

exec sp_executesql N'SELECT 1 AS [C1], [Extent1].[ptu_codtpl] AS [ptu_codtpl], [Extent2].[tpl_descripcion] AS [tpl_descripcion] FROM (SELECT [ptu_permisos_tpl_users].[ptu_codtpl] AS [ptu_codtpl], [ptu_permisos_tpl_users].[ptu_username] AS [ptu_username] FROM [sco].[ptu_permisos_tpl_users] AS [ptu_permisos_tpl_users]) AS [Extent1] LEFT OUTER JOIN [sal].[tpl_tipo_planilla] AS [Extent2] ON [Extent1].[ptu_codtpl] = [Extent2].[tpl_codigo] WHERE [Extent1].[ptu_username] = @p__linq__0',N'@p__linq__0 varchar(8000)',@p__linq__0='mpadilla'

​ Que se tarda entre 19 y 30 segundos en resolver.

El problema estriba en que utiliza la vista [sco].[ptu_permisos_tpl_users] que es un CROSS APPLY entre la tabla de usuarios y la función de permisos de tipos de planilla por usuario ​

Si se hace el query directo se resuelve rapidísimo ​

SELECT cast(nullif(codtpl, 0) as int) ptu_codtpl, isnull(usr_username, '') ptu_username FROM sec.usr_users CROSS APPLY sco.permiso_tipo_planilla_tabla(usr_username) where usr_username = 'mpadilla'

​ Pero al utilizar la vista, por tener que armar primero la vista es que se está tardando tanto tiempo.

¿Habrá forma de solucionarlo?

link

answered 20 Mar '20, 17:52

Lester%20Jimenez's gravatar image

Lester Jimenez
568816
accept rate: 33%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Evolution en BitBucket

En este sitio puede acceder al código fuente, centro de descargas y reportar bugs, propuestas y mejoras para Evolution.

Evolution en JIRA

En este sitio puedes sugerir nueva funcionalidad para Evolution, o puedes votar por la funcionalidad ya propuesta por otros usuarios.

Tags:

×16
×1
×1

Asked: 20 Mar '20, 12:39

Seen: 347 times

Last updated: 24 Mar '20, 16:27

[Acerca de] [Preguntas Frecuentes] [Privacidad] [Soporte] [Contacto]
Copyright 2013-2018. Asesores en Informática